//
//  SuggestionController.m
//  CaiPiao
//
//  Created by l wb on 2018/5/17.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "SuggestionController.h"

@interface SuggestionController ()
@property (weak, nonatomic) IBOutlet UITextView *textView;

@end

@implementation SuggestionController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"投诉建议";
    
}
- (IBAction)submitSuggestionClickAction:(UIButton *)sender {
    if (self.textView.text.length==0) {
        [EasyTextView showText:@"请输入你的投诉或者建议内容"];
        return;
    }
    BmobObject *object = [[BmobObject alloc] initWithClassName:@"Suggestions"];
    [object setObject:self.textView.text forKey:@"text"];
    [object saveInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error) {
        if (isSuccessful) {
            [EasyTextView showSuccessText:@"提交成功!"];
            [self.navigationController popViewControllerAnimated:YES];
        } else {
            [EasyTextView showErrorText:@"提交失败！"];
        }
    }];
    
}


@end
